<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- 移动石子直到连续 -->
    <script>
      var numMovesStones = function (a, b, c) {
        ;[a, b, c] = [a, b, c].sort((a, b) => a - b)
        if (c == b + 1 && b == a + 1) min = 0
        else if (c - b <= 2 || b - a <= 2) min = 1
        else min = 2
        return [min, c - a - 2]
      }
      console.log(numMovesStones(1, 2, 5))
    </script>
  </body>
</html>
